import lireg from '@/api/axios';

// 物料类型
export default {
  /**
   * @description: 所有栏栋舍相关接口
   */
  add(params) {
    return lireg.post("/v3/inventory/materialType/add", params)
  },

  // 编号删除
  numberDel(params) {
    return lireg.get(`/v3/inventory/materialType/delByNo?no=${params}`)
  },

  // 编号批量删除
  numberBatchDel(params) {
    let paramsCopy = { organizationNo: sessionStorage.organizationNo, ...params }
    return lireg.post("/v3/inventory/materialType/delListByNo", paramsCopy)
  },

  // 修改
  edit(params) {
    return lireg.post("/v3/inventory/materialType/edit", params)
  },

  // 条件查询
  conditionQuery(params) {
    return lireg.post("/v3/inventory/materialType/queryByCondition", params)
  },

  // 编号查询
  numberQuery(params) {
    return lireg.get(`/v3/inventory/materialType/queryByNo?no=${params}`)
  },
  // 编号批量查询
  numberBatchQuery(params) {
    return lireg.post("/v3/inventory/materialType/queryListByNo", params)
  },
  // 分页查询
  pageQuery(params) {
    return lireg.post("/v3/inventory/materialType/queryPageByCondition", params)
  },
  // 查询树状表
  TreeStructure() {
    return lireg.post("/v3/inventory/materialType/queryTree")
  },
  // 单节点树状结构
  queryOneNodeData(params) {
    return lireg.get(`/v3/inventory/materialType/queryTreeByNo?no=${params}&organizationNo=${sessionStorage.organizationNo}`)
  }
}
